package com.ab.filemanager.base.adapter

import androidx.recyclerview.widget.RecyclerView
import android.view.View
import com.anbang.app.R
import com.anbang.app.ui.frame.study.recycleView.adapter.ClickVo

/**
 * 创建作者：AnBang
 * 创建时间：2018/7/18
 * 功能描述：
 */
abstract class BaseViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

    var rootView: View = findView(R.id.rootView)

    var listener: ((ClickVo) -> Unit)? = null

    var longClickListener: ((ClickVo) -> Unit)? = null

    var dragListener: ((RecyclerView.ViewHolder) -> Unit)? = null

    fun <T : View> findView(viewId: Int): T {
        return itemView.findViewById(viewId)
    }

    abstract fun bindViewHolder(any: Any)
}